<template>
    <div class="normal">

        <!--S红包-->
        <red :red-id="redId" @loaded="loaded"></red>
        <!--E红包-->

        <!--S右下角控制按钮-->
        <control :red-id="redId" :owner="owner"></control>
        <!--E右下角控制按钮-->

        <!--S推广链接按钮-->
        <link-btn v-if="link" :link="link"></link-btn>
        <!--S推广链接按钮-->
    </div>
</template>

<script>
    import red from "../red/Red";
    import control from "../control/Control";
    import linkBtn from "../link-btn/LinkBtn";
    export default {
        name: "normal",
        data(){
            return {
                data:null,  //红包数据
                owner:"",  //红包所属用户id
                link:null,  //推广链接信息
            }
        },
        props:{
            redId:{
                type:String
            }
        },
        components:{
            red,
            control,
            "link-btn":linkBtn
        },
        methods:{
            loaded(data){
                this.data = data;
                this.owner = data.uid;
                if(data.link) this.link = data.link;
            }
        }
    }
</script>

<style scoped lang="less" src="./normal.less"></style>